//------------------------------------------------------------------------
bool FormatLoad::skipToValidLine()
{
- QRegularExpression regex("^file|serial");
+ static const QRegularExpression regex("^file|serial");
while ((currentLine_ < lines_.size()) && !regex.match(lines_[currentLine_]).hasMatch()) {
currentLine_++;
}
#ifndef GENERATE_CORE_STRINGS
if (htmlPage.length() > 0 && Format::getHtmlBase().length() == 0) {
QString base = htmlPage;
- base.replace(QRegularExpression("/[^/]+$"), "/");
+ static const QRegularExpression re("/[^/]+$");
+ base.replace(re, "/");
Format::setHtmlBase(base);
}
#endif
{
QString url = urlIn;
- if (!url.contains(QRegularExpression(R"(^https?://)"))) {
+ static const QRegularExpression re(R"(^https?://)");
+ if (!url.contains(re)) {
url = Format::getHtmlBase() + url;
}
QDesktopServices::openUrl(QUrl(url));